package com.yingxin.yxerp.module.sys.entity.enums;

import cn.hutool.core.util.ObjectUtil;

/**
 * 群发消息平台 - 枚举
 */

public enum MessageSendingOptionsType {

    ZERO("0","无"),
    ONE("1","钉钉"),
    TWO("2","企业微信"),
    ;

    private String type;

    private String typeName;

    MessageSendingOptionsType(String type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public static MessageSendingOptionsType getEnum(String type) {
        if( ObjectUtil.isEmpty( type ) ){
            return null;
        }
        for ( MessageSendingOptionsType i : MessageSendingOptionsType.values() ) {
            if ( i.getType().equals( type ) ) {
                return i;
            }
        }
        return null;
    }

}
